(function() {
    "use strict";

    rapid.debug = true;
    rapid.appSecret = '32BA6B42AF146A96B7CA4c571550B91E311c38C1iC4BABD938I8E2F012D4BE1AA1';
    rapid.appId = '2da1df777612415f87314a6acb15c222';

    rapid.TEXT_COLOR = {
        "1-7": /(创建|新增|新建|添加|追加|插入|生成|修改|编辑|更新|fa-pencil|fa-edit)/i,
        "1-6": /(查看|确定|完成|ok|fa-eye)|^(是)$/i,
        "3-6": /(提交|保存|搜索|查询|查找|启用|允许|同意|通过|正确|保留|fa-check)/i,
        "7-6": /(放弃|禁用|禁止|拒绝|不同意|不通过)|^(否)$/i,
        "8-7": /(删除|移除|清除|清空|错误|fa-trash|fa-ban|fa-times)/i,
        "12-7": /(重置|导入|导出|设置|配置|参数|审核|审批)/i
    };

    // 页面全局设置
    rapid.Page.settings({
        bodyBgColor: "0-5",
        titleBarBgColor: "12-8"
    });

    // 全局ui设置，如有需要，可单独在对应页面的脚本中重新设置
    rapid.ui.settings({
        // 是否需要兼容其它ui库
        compatible: true
    }, {
        message: {
            color: 12
        },
        window: {
            headerPalette: {
                bg: true,
                bd: true,
                bgColor: 12,
                bgDepth: 8
            },
            bodyPalette: {
                bg: true
            },
            footerPalette: {
                bg: true,
                bd: true
            },
            // 顶部下方阴影
            headerShadow: false,
            // 窗体阴影
            bodyShadow: true,
            // 底部上方阴影
            footerShadow: false,
            // 窗体按钮自动上色
            buttonAutoColor: true
        },
        checkbox: {
            color: 4
        },
        radio: {
            color: 4
        },
        button: {
            autoColor: true
        },
        textbox: {
            // default, inline
            //labelStyle: "inline",
            // normal, bold
            labelFontWeight: "normal",
            // default, underline
            style: "default",
            color: 1,
            colorMode: "defualt",
            iconBgColor: false
        },
        picker: {
            // default, inline
            labelStyle: "inline",
            // normal, bold
            labelFontWeight: "normal",
            // default, underline
            style: "default",
            color: 1,
            colorMode: "defualt",
            iconBgColor: false
        },
        datetimepicker: {
            // default, inline
            labelStyle: "inline",
            // normal, bold
            labelFontWeight: "normal",
            // default, underline
            style: "default",
            color: 1,
            colorMode: "defualt",
            iconBgColor: false
        },
        dataview: {
            // 标题
            //title: "",
            // true, false, border样式(trbl)
            //border: false,
            bodyPalette: {},
            headerPalette: {},
            // "xxs", "xs", "sm", "default", "lg", "xl", "xxl"
            //padding: "default",
            // "xxs", "xs", "sm", "default", "lg", "xl", "xxl"
            //rowSpacing: "default",
            // dataview插件中控件外观
            controlStyle: {
                //labelStyle: "inline"
            }
        },
        pagination: {
            // t、tb、r、rl、all
            border: "all",
            controlColor: 1,
            palette: {
                bd: true,
                bg: false,
                font: false
            },

            refresh: true,
            gotoPage: true,
            nav: true,
            fastStep: 10, // <= 1
            startEnd: true,
            numeric: 5, // <= 1
            sizeSelectable: true,
            size: 20,
            sizeRange: [20, 50, 100],
            minSize: 1,
            maxSize: 100
        },
        grid: {
            bodyPalette: {
                bd: true
            },
            titlePalette: {
                bd: true
            },
            headerPalette: {
                bd: true
            },
            cellPalette: {
                bd: true
            },
            footerPalette: {},
            headerMenuBodyPalette: {},
            headerMenuActionPalette: {},
            rowMenuBodyPalette: {},
            rowMenuActionPalette: {},
            headerShadow: true,
            bodyShadow: true,
            footerShadow: true,

            // 是否显示行号，不建议显示，行号将最为固定列展示
            // 凡拥有固定列的Grid，将会增加额外的性能消耗，具体视每页的数据量
            rowId: false,
            // "auto", "fill"
            // auto相当于紧凑型，fill会填满表格
            // 是否隔行变色:true
            striped: true,
            // 是否显示状态栏:true
            status: true,
            // 是否可以全屏切换:true
            fullScreen: false,
            // 是否展现选中行的样式:true
            selectStyle: true,
            selectColor: 1,
            loadingColor: 1,
            controlColor: 1,
            // 标题文字粗体:true
            headerFontBold: false,
            // "nowrap", "auto", "visit", "toggleVisit", "always", Number
            // nowrap不增加性能消耗，其它值的消耗从左到右依次增加，具体视每页的数据量
            // 在rowId == false && 无操作列 && 无固定列 时，均无消耗
            rowHeight: "nowrap",
            cellFocusable: true,
            // default：采用grid默认配置（大多数情况下为center），left、center、right
            titleAlign: "default",
            // default：采用grid默认配置（大多数情况下为left），left、center、right
            cellAlign: "default",

            requestName: null,
            requestModel: {
                pageIndex: "pageIndex",
                pageSize: "pageSize",
                firstPage: "firstPage",
                lastPage: "lastPage",
                sortFields: "sortFields",
                groupFields: "groupFields"
            },
            responseModel: {
                data: "list",
                count: "recordCount"
            },

            pageable: false
        },
        list: {
            color: 1
        }
    });
})();